<template>
	<view id="printBox" class="table_content_main">
		<view class="table_content_main_title fonts24 fontw700">{{ vo1.fullName||"无名氏"}}标准简历</view>
		<view class="table_contents">
			<view class="flex table_tr">
				<view class="flex">
					<view class="">
						<view class="flex">
							<view class="table_th">姓名</view>
							<view class="table_td">{{ vo1.fullName || "无" }}</view>
							<view class="table_th">性别</view>
							<view class="table_td">{{ vo1?vo1.gender?dict(vo1.gender, "sys_user_sex"): "无":"无" }}</view>
							<view class="table_th">年龄</view>
							<view class="table_td">{{ vo1.age || "无" }}</view>
						</view>
						<view class="flex">
							<view class="table_th">民族</view>
							<view class="table_td">{{ vo1.nation || "无" }}</view>
							<view class="table_th">籍贯</view>
							<view class="table_td">{{ vo1.nativePlace || "无" }}</view>
							<view class="table_th">婚姻状况</view>
							<view class="table_td">{{ vo1?vo1.marriage?dict(vo1.marriage, "marriage"): "无":"无" }}</view>
						</view>
						<view class="flex">
							<view class="table_th">政治面貌</view>
							<view class="table_td">
								{{ vo1?vo1.politicalOutlook?dict(vo1.politicalOutlook, "political_outlook"):"无":"无" }}</view>
							<view class="table_th">参加工作时间</view>
							<view class="table_td">{{ vo1?vo1.startWorkTime?vo1.startWorkTime.slice(0,7): "无" :"无"}}</view>
							<view class="table_th">健康状况</view>
							<view class="table_td">{{ vo1.health || "无" }}</view>
						</view>
					</view>
					<view  class="" style="border: 1px solid #0094ff;">
						<view style="width:119px;height: 112px;">
							<img style="width: 100%;height: 100%;" v-if="vo1.photoUrl" :src="vo1.photoUrl" alt="" />
							<!-- <img style="width: 100%;height: 100%;" v-else src="@/assets/imgs/k1.png" alt="" /> -->
						</view>
					</view>
				</view>
			</view>
			<view class="flex table_tr">
				<view class="table_th">电子邮箱</view>
				<view class="table_td2">{{ vo1.email || "无" }}</view>
				<view class="table_th">熟悉专业/有何专长</view>
				<view class="table_td2">{{ vo1.majorAndSpecialty || "无" }}</view>
			</view>
			<view class="flex table_tr">
				<view class="table_th">身份证号</view>
				<view class="table_td2">{{ vo1.idNumber || "无" }}</view>
				<view class="table_th">现住地址</view>
				<view class="table_td2">{{ vo1.currentAddress || "无" }}</view>
			</view>
			<view class="flex table_tr">
				<view class="table_th">户籍地址</view>
				<view class="table_td3">{{ vo1.registeredAddress || "无" }}</view>
			</view>
			<view class="flex table_tr">
				<view class="table_th">联系电话</view>
				<view class="table_td2">{{ vo1.phoneNumber || "无" }}</view>
				<view class="table_th">紧急联系人及电话</view>
				<view class="table_td2">{{ vo1.emergencyPhoneNumber || "无" }}</view>
			</view>

			<view class="flex table_tr">
				<view class="table_th">职业资格/专业技术（职称）</view>
				<view class="table_td2">无</view>
				<view class="table_th">重点人群信息</view>
				<view class="table_td2">{{vo1?vo1.keyPopulationInformation? dict(vo1.keyPopulationInformation,
			            "key_population_information") : "无":"无"
			        }}</view>
			</view>
			<!-- 教育经历 -->
			<view class="">
				<view class="flex table_tr">
					<view class="table_th">教育经历</view>
					<view class="table_td4" >
						<view class="" v-if="vo2.length == 0">无</view>
						<view class="" v-else>
							<view class="" v-for="(item, index) in vo2" :key="index">
								{{ item.educationLevel?dict(item.educationLevel, "education"):"暂无学历信息" }}
								{{ item.experienceStartTime?item.experienceStartTime.slice(0, 7):"" }}至{{
								           item.experienceEndTime?item.experienceEndTime.slice(0, 7):"" }} {{ item.schoolName }} {{ item.isFullTimeEducation==1?"非全日制":"全日制" }} {{ item.specialFieldName }}<br />
								专业描述：{{ item.specialFieldDescription || "无" }} <br />
								<!-- 学历证书编号：{{ item.xuexinCoding }}<br /> -->
								学历附件：<span style="margin-right: 16px;" v-for="(items, indexs) in item.files"
									:key="indexs"><a :href="items.url">{{ "附件" + (indexs + 1) }}</a>
								</span>
							</view>
						</view>
					</view>
				</view>

			</view>
			<!-- 工作经历 -->
			<view class="">
				<view class="flex table_tr">
					<view class="table_th">工作经历 （自毕业填起）</view>
					<view class="table_td4" v-if="vo3.length == 0">
						无
					</view>
					<view class="table_td4" v-else>
						<view class="" v-for="(item, index) in vo3" :key="index">
							{{ item.experienceStartTime?item.experienceStartTime.slice(0, 7):"" }} 至 {{
							           item.experienceEndTime?item.experienceEndTime.slice(0, 7):"至今" }} {{ item.companyName }} {{ item.positionName }} <br />
							所在部门：{{ item.positionName || "无" }} <br />
							工作描述：{{ item.workDescription || "无"}}
						</view>
					</view>
				</view>

			</view>
			<!-- 奖惩情况 -->
			<view class="flex table_tr">
				<view class="table_th">业绩及奖惩情况</view>
				<view class="table_td3">{{ vo4  || "无" }}</view>
			</view>
			<!-- 项目经历 -->
			<view class="">
				<view class="flex table_tr">
					<view class="table_th">项目经历</view>
					<view class="table_td4" v-if="vo5.length ==0">
						无
					</view>
					<view class="table_td4" v-else>
						<view class="td2" v-for="(item, index) in vo5" :key="index">
							{{ item.experienceStartTime?item.experienceStartTime.slice(0, 7):"" }} 至 {{
							           item.experienceEndTime?item.experienceEndTime.slice(0, 7):"至今" }} {{ item.projectName }} {{ item.positionName }} <br />
							<!-- 所在部门：{{ item.departmentName || "无" }} -->
							<br />
							项目描述：{{ item.projectDescription || "无"}}
						</view>
					</view>
				</view>

			</view>
			<!-- 资格证书 -->
			<view class="">
				<view class="flex table_tr">
					<view class="table_th">资格证书</view>
					<view class="table_td4" v-if="vo6.length == 0">
						无
					</view>
					<view class="table_td4" v-else>
						<view class="td2" v-for="(item, index) in vo6" :key="index">
							{{ item.certificateName }} {{ item.issuanceTime?item.issuanceTime.slice(0, 7):"" }} <br />
							颁发单位：{{ item.issuanceUnit }}<br />
							证书种类：{{item.certificateType? dict(item.certificateType,"sys_certificate_type"):"暂无信息" }}<br />
							资格证书附件：<span style="margin-right: 16px;" v-for="(items, indexs) in item.files"
								:key="indexs"><a :href="items.url">{{ "附件" + (indexs + 1) }}</a>
								</span>
						</view>
					</view>
				</view>

			</view>
			<!-- 培训 -->
			<view class="">
				<view class="flex table_tr">
					<view class="table_th">培训经历</view>
					<view class="table_td4" v-if="vo7.length == 0">
						无
					</view>
					<view class="table_td4" v-else>
							<view class="td2"  v-for="(item, index) in vo7" :key="index">
							{{ item.experienceStartTime?item.experienceStartTime.slice(0, 7) :""}} 至 {{
							           item.experienceEndTime?item.experienceEndTime.slice(0, 7):"至今" }} {{ item.experienceName }} {{ item.experienceDirections }}
							<br />
							培训描述：{{ item.experienceDescription }} <br />
							</view>
						</view>
				</view>
			</view>
			<!-- 技能 -->
			<view class="">
				<view class="flex table_tr">
					<view class="table_th">专业技能</view>
					<view class="table_td4" v-if="vo8.length == 0">
						无
					</view>
					<view class="table_td4" v-else >
						<view class="td2" v-for="(item, index) in vo8" :key="index">
							{{ item.masterTime }}个月 {{ item.skillName }} {{ item.proficiencyLevel?dict(item.proficiencyLevel,
							           "proficiency_level"):"" }} <br />
						</view>
					</view>
				</view>
			</view>
			<!-- 奖惩情况 -->
			<view class="flex table_tr">
				<view class="table_th">自我评价</view>
				<view class="table_td3">{{ vo9  || "无" }}</view>
			</view>
			<!-- 家庭关系 -->
			<view class="flex table_tr">
				<view class="table_th">家庭主要成员及重要社会关系（未婚/离异填父母、兄弟界面；已婚填配偶、子女）</view>
				<view class="table_td7" >
					<view class="" v-if="vo10.length == 0">
						无
					</view>
					<view class="" v-else>
						<view class="flex">
							<view class="table_td5">称谓</view>
							<view class="table_td5">姓名</view>
							<view class="table_td5">出生年月</view>
							<view class="table_td5">政治面貌</view>
							<view class="table_td5">工作单位及职务</view>
							<view class="table_td5">联系方式</view>
						</view>
						<view class="flex" v-for="(item, index) in vo10" :key="index">
							<view class="table_td5">{{ item.title }}</view>
							<view class="table_td5">{{ item.fullName }}</view>
							<view class="table_td5">{{ item.brithDay?item.brithDay.slice(0,7):"" }}</view>
							<view class="table_td5">{{ item.politicalOutlook ?dict(item.politicalOutlook,
					        "political_outlook"):""}}</view>
							<view class="table_td5">{{ item.workUnitAndPosition }}</view>
							<view class="table_td5">{{ item.contactInformation }}</view>
						</view>
					</view>
				</view>
				
			</view>
			<!-- 本人承诺 -->
			<view class="flex table_tr">
				<view class="table_th">本人承诺</view>
				<view class="table_td6">
					&nbsp;&nbsp;&nbsp;&nbsp;
					本人郑重承诺：本人向成都香城人力资源开发有限公司提供应聘简历、身份信息、教育经历、工作履历、证书证件等个人信息完全真实可靠，不存在弄虚作假情况。如证实本人提供的个人信息存在虚假情况，本人愿意承担相应的法律责任。
					<p class="th_b_p">
						<span>本人签名</span>
						<span>年</span>
						<span>月</span>
						<span>日</span>

					</p>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		dictFuns
	} from "@/util/dictionary";
	export default {
		props: ["data"],
		data() {
			return {
				vo1: {}, //个人信息
				vo2: {}, //教育经历
				vo3: {}, //工作履历
				vo4: {}, //业绩及奖惩情况
				vo5: {}, //项目经历
				vo6: {}, //资格证书
				vo7: {}, //培训经历
				vo8: {}, //专业技能
				vo9: {}, //自我评价
				vo10: {}, //家庭
				vo11: {}, //本人承诺
			}
		},
		watch: {
			data: {
				handler: function(newValue) {
					console.log("简历", newValue);
					this.vo1 = newValue?.personalInformation
					console.log("个人数据：", this.vo1);
					this.vo2 = newValue?.educationExperiences
					this.vo3 = newValue?.workExperiences //工作
					this.vo4 = newValue?.personalInformation?.performanceRewardsPunishments || "无" //业绩及奖惩
					this.vo5 = newValue?.projectExperiences //项目
					this.vo6 = newValue?.certificates //证书
					this.vo7 = newValue?.trainingExperiences //培训
					this.vo8 = newValue?.skills //技能
					this.vo9 = newValue?.personalInformation?.selfEvaluation || "无" //自我评价
					this.vo10 = newValue?.familyMembers //家庭
					this.vo11 = newValue?.selfCommitment //本人承诺
				},
				deep: true,
				// immediate: true
			}
		},
		methods: {
			dict(value, res) {
				return dictFuns(value, res)
			},
			classClick(item) {
				this.indexValue = item.id
			}
		}
	}
</script>
<style lang="scss" scoped>
	.table_content_main_title {
		display: flex;
		justify-content: center;
		align-content: center;
		padding: 10px;
	}

	// 762 558 102 112
	.table_contents {
		width: 762px;
	}

	.table_td2 {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 259px;
		padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;
	}

	.table_td5 {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 108px;
		min-height: 30px;
		// padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;
	}

	.table_td4 {
		// display: flex;
		// justify-content: center;
		// align-items: center;
		width: 660px;
		padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;
	}
	.table_td7 {
		display: flex;
		// justify-content: center;
		// align-items: center;
		width: 660px;
		// padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;
	}

	.table_td3 {
		display: flex;
		// justify-content: center;
		align-items: center;
		width: 660px;
		padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;

	}

	.table_td6 {
		width: 660px;
		padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;
		.th_b_p {
			text-align: right;
			margin-top: 30px;
			margin-bottom: 20px;
			span {
				margin-left: 100px;
				&:nth-child(1) {
					margin-right: 100px;
				}
			}
		}
	}

	.table_th {
		width: 80px;
		padding: 10px;
		background-color: #f4f4f4;
		display: flex;
		justify-content: center;
		align-items: center;
		border: 1px solid #0094ff;
		font-size: 12px;
	}

	.table_td {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 90px;
		padding: 10px;
		border: 1px solid #0094ff;
		font-size: 12px;
	}

	.table_content {

		// width: 100%;
		background: #FFFFFF;
		border-radius: 0px 0px 0px 0px;
		opacity: 1;
		position: relative;

		.table_content_button {
			position: absolute;
			right: 36px;
			top: 36px;
		}
	}
</style>
